package com.biz.primus.model.member.enums;

import com.biz.primus.common.enums.EnumerableValue;
import com.biz.primus.common.enums.converter.BaseEnumValueConverter;

/**
 * 类说明：婚姻状况枚举
 *
 * @author jun.liu
 */
public enum
MaritalStatusTypes implements EnumerableValue
{

    secret(0, "保密"),
    single(1, "未婚"),
    married(2, "已婚"),
    widowed(3, "丧偶"),
    divorced(4, "离异")
    ;

    public static class Converter extends BaseEnumValueConverter<MaritalStatusTypes>
    {
    }

    private int value;
    private String desc;

    MaritalStatusTypes(int value, String desc)
    {
        this.value = value;
        this.desc = desc;
    }

    @Override
    public int getValue() {
        return value;
    }

    public String getDesc() {
        return desc;
    }

    public static MaritalStatusTypes getWedlockByValue(int codeVal)
    {
        for (MaritalStatusTypes wedlock : MaritalStatusTypes.values())
        {
            if (wedlock.getValue() == codeVal)
            {
                return wedlock;
            }
        }
        return null;
    }
}
